//
//  MenuViewController.m
//  News
//
//  Created by Han on 15-4-13.
//  Copyright (c) 2015年 IPingLun. All rights reserved.
//

#import "MenuViewController.h"

@interface MenuViewController ()

@end

@implementation MenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self drawView];
}


- (void)drawView {
    self.view.backgroundColor = [UIColor greenColor];
    
    UIButton *button1 = UIButton.new;
    button1.tag = 0;
    button1.backgroundColor = [UIColor redColor];
    [button1 addTarget:self action:@selector(clickButton1:) forControlEvents:UIControlEventTouchUpInside];
    button1.selected = YES;
    [self.view addSubview:button1];
    
    [button1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.top).offset(30);
        make.left.equalTo(self.view.left).offset(0);
        make.size.equalTo(CGSizeMake(200, 28));
    }];
    
    UIButton *button2 = UIButton.new;
    button2.tag = 0;
    button2.backgroundColor = [UIColor redColor];
    [button2 addTarget:self action:@selector(clickButton2:) forControlEvents:UIControlEventTouchUpInside];
    button2.selected = YES;
    [self.view addSubview:button2];
    
    [button2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.top).offset(80);
        make.left.equalTo(self.view.left).offset(0);
        make.size.equalTo(CGSizeMake(200, 28));
    }];

}

- (void)clickButton1:(UIButton *) button {
    
    MainViewController *mainView = [MainViewController sharedInstance];
    //SwipeNavigationController *nav = [[SwipeNavigationController alloc] initWithRootViewController:mainView];
    
    
    BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:mainView];
    [nav setEnableBackGesture:true];
    
    //self.frostedViewController.contentViewController = nav;
    
    //[self.frostedViewController hideMenuViewController];
}


- (void)clickButton2:(UIButton *) button {
    
    AboutViewController *aboutView = [[AboutViewController alloc] init];
    [aboutView setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    
    
    [self presentViewController:aboutView animated:YES completion:nil];
    
    //NewsDetailViewController *newsDetail = NewsDetailViewController.new;
    //[self.navigationController pushViewController:newsDetail animated:YES];
    
    /*
    AboutViewController *aboutView = [[AboutViewController alloc] init];
    //SwipeNavigationController *nav = [[SwipeNavigationController alloc] initWithRootViewController:aboutView];
    BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:aboutView];
    [nav setEnableBackGesture:true];
    
    self.frostedViewController.contentViewController = nav;
    
    [self.frostedViewController hideMenuViewController];
    */
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
